Pythonで学ぶ音声合成 Quick startをスクリプトで動かす
Jupyter Notebookの例
スクリプトにし、CPUでまず動かす
依存関係
ttslearn==0.2.2
numpy==1.21.5が入った
sounddevice==0.4.4
code:python
>> from ttslearn.dnntts import DNNTTS
>> dnntts_engine = DNNTTS()
The use of pre-trained models is permitted for non-commercial use only.
>> wav, sr = dnntts_engine.tts("あらゆる現実を、すべて自分のほうへねじ曲げたのだ。")
>> type(wav)
<class 'numpy.ndarray'>
>> type(sr) # sampling_rate
<class 'int'>
>> wav.shape
(61760,)
>> sr
16000
>> import sounddevice as sd
>> sd.play(wav, sr)
>> sd.wait()